package com.xtaller.easy.admin.mapper;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.xtaller.easy.admin.model.SysLabel;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* Created by Taller on 2018/04/13
*/
@Mapper
public interface SysLabelMapper extends BaseMapper<SysLabel> {
    @Select("Select * from sys_label where isDel=0 and (moduleId=#{id} or parentId=#{id})")
    List<SysLabel> getByModuleIdOrParentId(@Param("id") String id);
    @Select("Select id,moduleId,parentId,name,code,remark,type from sys_label where isDel=0 order by sort")
    List<JSONObject> getTreeLabel();

}